<html>

<head>
    <meta charset="utf-8" />

    <title>Shopping Cart Update</title>

    <script src="scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
	<script src="scripts/popupjoe.js" type="text/javascript"></script>

	<script type="text/javascript">
	    $(document).ready(function () {
	        fn.Bind("btnSubmit", "update");

	        $('.qty').bind('change', function () {
	            var total = 0;

	            $('.qty').each(function () {
	                total += Number($(this).val()) * Number($(this).parent().parent().find('.price').text());
	            });

	            $('#total').html(total);
	        });
	    });

	    function GetItems() {
	        var items = [];

	        $('.product').each(function () {
	            var parent = $(this).parent();

	            if (Number(parent.find('.qty').val()) > 0) {
	                var item = {
	                    ProductName: $(this).text(),
	                    ItemCategory: "",
	                    SKU: parent.find('.sku').text(),
	                    Price: Number(parent.find('.price').text()),
	                    Quantity: Number(parent.find('.qty').val())
	                };

	                items.push(item);
	            }
	        });

	        return { Item: items };
	    }
	</script>	
</head>

<body>

<h1>Shopping Cart Update</h1>

<table border="0" width="50%">
    <thead>
        <tr>
            <td><b>Product</b></td>
            <td><b>SKU</b></td>
            <td><b>Price</b></td>
            <td><b>Qty</b></td>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td class="product">Dell Desktop:</td>
            <td class="sku">DDSKU</td>
            <td class="price">35</td>
            <td><input type="text" class="qty" /></td>
        </tr>
        <tr>
            <td class="product">Dell Laptop:</td>
            <td class="sku">DLSKU</td>
            <td class="price">55</td>
            <td><input type="text" class="qty" /></td>
        </tr>
        <tr>
            <td class="product">Lenovo Desktop:</td>
            <td class="sku">LDSKU</td>
            <td class="price">45</td>
            <td><input type="text" class="qty" /></td>
        </tr>
        <tr>
            <td class="product">Lenovo Laptop:</td>
            <td class="sku">LLSKU</td>
            <td class="price">65</td>
            <td><input type="text" class="qty" /></td>
        </tr>
        <tr>
            <td><b>Total:</b></td>
            <td></td>
            <td id="total"></td>
            <td></td>
        </tr>
    </tbody>
</table>

<br /><br />
<input type="button" value="Update" id="btnSubmit" />&nbsp;
<a href="checkout.htm">Check Out</a>	
</body>

</html>